#ifndef EVENTS_H_
#define EVENTS_H_
#include "Poco/DateTime.h"
#include "CommonDefExtention.h"
#include <string>

class Events {

public:
	enum eEvents{
		create,
		consume,
		buy,
		sell,
		userReport,
		energyReport,
		profitReport,
		activityReport,
		accountReport,

		error,
	};
	inline static std::string eEventsName(eEvents event)
		{
			switch (event){
				case create :		    return "create";
				case consume :		    return "consume";
				case buy :		    	return "buy";
				case sell :		    	return "sell";
				case userReport :		return "userReport";
				case energyReport :	    return "energyReport";
				case profitReport :		return "profitReport";
				case activityReport :   return "activityReport";
				case accountReport :    return "accountReport";
				default :				return "Unknown event";
			}
		}

protected:
	 const eEvents type;

public:

	 const Poco::DateTime * const date;

	 static bool after (Events* elem1, Events* elem2);

	 Events();
	 Events(const Poco::DateTime * const _date);

	 //should return posotive int if this happens before other;
	 //negative if other happens before this; 0 otherwise.
	 virtual int compareTo(Events &other) const=0;
	 virtual eEvents getType() const=0;

	 virtual ~Events();
};


#endif /*EVENTS_H_*/
